/**
 * main.cpp for tigerrad
 * fall 2006
 */

#include "SDLWindow.h"
#include "Simulation.h"
#include "CornellBoxScene.h"
#include "Engine.h"

/**
 * tigerrad entry point
 */
int main(int argc, char** argv)
{
	try {
		bool fullscreen = false;
		if (argc > 1) {
			std::string op(argv[1]);
			if (op == "-fs") {
				fullscreen = true;
			}
		}
		Vec2s size(640,480);
		//Vec2s size(512, 512);
		//Vec2s size(480,480);
		//Vec2s size(800,600);
		//Vec2s size(1024,768);
		//Vec2s size(1280, 1024);
		SDLWindow window(size, 24, fullscreen);
		EnginePtr engine(new Engine());
		ScenePtr scene(new CornellBoxScene());
		SimulationPtr sim(new Simulation(scene, engine));
		window.setSimulation(sim);
		window.setEngine(engine);

		window.mainLoop();
	} catch (const std::string& msg) {
		std::cerr << msg << std::endl;
	} catch (...) {
		std::cerr << "Woops, someone threw an unexpected exception..." << std::endl;
	}
}

